package com.xpgk.mvc.bsendMessage;

import com.jfinal.plugin.redis.Cache;
import com.jfinal.plugin.redis.Redis;

public class CountUtils {
	
	public static long incrCount(String key,int startCount,int expireSeconds){
		Cache cache = Redis.use();
		if(!cache.exists(key)){//
			cache.incrBy(key, startCount);
			cache.expire(key, expireSeconds);
		}
		return cache.incr(key);
	}
	public static void decrCount(String key){
		Cache cache = Redis.use();
		cache.decr(key);
	}

}
